# Contributor: August Klein <amatcoder@gmail.com>
# Contributor: Antoine Fontaine <antoine.fontaine@epfl.ch>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=deluge
pkgver=2.1.1
pkgrel=0
pkgdesc="lightweight, Free Software, cross-platform BitTorrent client"
url="https://deluge-torrent.org/"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	gtk+3.0
	py3-cairo
	py3-chardet
	py3-distro
	py3-gobject3
	py3-libtorrent-rasterbar
	py3-mako
	py3-openssl
	py3-pillow
	py3-rencode
	py3-service_identity
	py3-setproctitle
	py3-setuptools
	py3-six
	py3-twisted
	py3-wheel
	py3-xdg
	py3-zope-interface
	"
makedepends="
	py3-build
	py3-installer
	py3-wheel
	"
checkdepends="
	py3-mock
	py3-pytest
	"
options="!check" # failing ui off-by-one size tests, segfault in another
subpackages="$pkgname-doc"
source="http://download.deluge-torrent.org/source/${pkgver%.*}/deluge-$pkgver.tar.xz"

replaces="$pkgname-lang" # Overwrite removed subpackage

build() {
	python3 -m build --no-isolation --wheel
}

check() {
	pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/deluge-$pkgver-py3-none-any.whl
}

sha512sums="
e94208981aee45f42b88e1c544b07e7b0d0f2c4ade6b7f37257b69d4a3394c89aff217cde699e79ad59de6d2ee4eca7a558f2b85505d2140ba73f1f76f184455  deluge-2.1.1.tar.xz
"
